package controller;

import bean.Order;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import service.OrderService;

@RestController
@RequestMapping(value = "/order")
public class OrderController {

    private OrderService orderService;

    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    @RequestMapping(value = "/buy",method = RequestMethod.GET)
    public Order buy(){
        Order order = new Order(123, "RFX01");
        orderService.buy(order);
        return order;
    }
}
